import { FormSchema } from "/@/components/Table";
import { BasicColumn } from "/@/components/Table/src/types/table";
import {listOptionHospital} from "/@/api/demo/hospital";


export const columns:BasicColumn[]=[
    {
        title:'科室名称',
        dataIndex:'deptName',
        width:120
    },
    {
        title:'状态',
        dataIndex:'state',
        width:120
    },
    {
        title:'创建时间',
        dataIndex:'gmtCreat',
        width:120
    }
]

export const departmentSearchScheme:FormSchema[]=[
  {
    label: '医院',
    field: 'hospitalId',
    component: 'ApiSelect',
    // required: true,
    colProps:{span: 6},
    componentProps: {
      api: listOptionHospital,
      labelField: 'name',
      labelValue: 'id',

      onChange: (e, v) => {
        console.log('ApiSelect====>:', e, v);
      },
      onOptionsChange: (options) => {
        console.log('options', options)
      },
    }
  },
  {
    label:'科室名称',
    field:'deptName',
    component:'Input',
    colProps:{span:6}
  },
]

export const departmentFormScheme:FormSchema[]=[
    {
        label:'id',
        field:'id',
        component:'Input',
        show:false
    },
    {
        label:'科室名称',
        field:'deptName',
        component:'Input',
        required:true
    },
  {
    label:'医院',
    field:'hospitalId',
    component:'ApiSelect',
    required:true,
    componentProps:{
      api:listOptionHospital,
      labelField:'name',
      labelValue:'id',
      onChange: (e, v) => {
        console.log('ApiSelect====>:', e, v);
      },
      onOptionsChange:(options)=>{
        console.log('options',options)
      },
      defaultValue:'0'
    }
  },
    // {
    //     label:'选择父节点',
    //     field:'pid',
    //     component:'ApiSelect',
    //     componentProps:({formModel})=>{
    //       return {
    //
    //       }
    //     }
    //
    // }
]

